<?php class Eventsbuilding { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: SpentM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $SpentM;

    /***
     * DB Fields: SpentC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $SpentC;

    /***
     * DB Fields: SpentD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $SpentD;

    /***
     * DB Fields: Time
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Time;

    /***
     * DB Fields: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $EventName;

    /***
     * DB Fields: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Type;

    /***
     * DB Fields: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $UserId;

    /***
     * DB Fields: PlanetId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $PlanetId;

    /***
     * DB Fields: elementId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $elementId;

    /***
     * DB Fields: elementLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $elementLevel;

    /***
     * DB Fields: elementType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $elementType;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: SpentM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result SpentM
     **/
    function get_SpentM( ) {
        // returns the value of SpentM
        return $this->SpentM;
    }


    /***
     * Get value for field: SpentC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result SpentC
     **/
    function get_SpentC( ) {
        // returns the value of SpentC
        return $this->SpentC;
    }


    /***
     * Get value for field: SpentD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result SpentD
     **/
    function get_SpentD( ) {
        // returns the value of SpentD
        return $this->SpentD;
    }


    /***
     * Get value for field: Time
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Time
     **/
    function get_Time( ) {
        // returns the value of Time
        return $this->Time;
    }


    /***
     * Get value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result EventName
     **/
    function get_EventName( ) {
        // returns the value of EventName
        return $this->EventName;
    }


    /***
     * Get value for field: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Type
     **/
    function get_Type( ) {
        // returns the value of Type
        return $this->Type;
    }


    /***
     * Get value for field: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result UserId
     **/
    function get_UserId( ) {
        // returns the value of UserId
        return $this->UserId;
    }


    /***
     * Get value for field: PlanetId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result PlanetId
     **/
    function get_PlanetId( ) {
        // returns the value of PlanetId
        return $this->PlanetId;
    }


    /***
     * Get value for field: elementId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result elementId
     **/
    function get_elementId( ) {
        // returns the value of elementId
        return $this->elementId;
    }


    /***
     * Get value for field: elementLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result elementLevel
     **/
    function get_elementLevel( ) {
        // returns the value of elementLevel
        return $this->elementLevel;
    }


    /***
     * Get value for field: elementType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result elementType
     **/
    function get_elementType( ) {
        // returns the value of elementType
        return $this->elementType;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: SpentM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param SpentM
     * @result void
     **/
    function set_SpentM( $SpentM ) {
        // sets the value of SpentM
        $this->SpentM = $SpentM;
    }

    /***
     * Set value for field: SpentC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param SpentC
     * @result void
     **/
    function set_SpentC( $SpentC ) {
        // sets the value of SpentC
        $this->SpentC = $SpentC;
    }

    /***
     * Set value for field: SpentD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param SpentD
     * @result void
     **/
    function set_SpentD( $SpentD ) {
        // sets the value of SpentD
        $this->SpentD = $SpentD;
    }

    /***
     * Set value for field: Time
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Time
     * @result void
     **/
    function set_Time( $Time ) {
        // sets the value of Time
        $this->Time = $Time;
    }

    /***
     * Set value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param EventName
     * @result void
     **/
    function set_EventName( $EventName ) {
        // sets the value of EventName
        $this->EventName = $EventName;
    }

    /***
     * Set value for field: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Type
     * @result void
     **/
    function set_Type( $Type ) {
        // sets the value of Type
        $this->Type = $Type;
    }

    /***
     * Set value for field: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param UserId
     * @result void
     **/
    function set_UserId( $UserId ) {
        // sets the value of UserId
        $this->UserId = $UserId;
    }

    /***
     * Set value for field: PlanetId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param PlanetId
     * @result void
     **/
    function set_PlanetId( $PlanetId ) {
        // sets the value of PlanetId
        $this->PlanetId = $PlanetId;
    }

    /***
     * Set value for field: elementId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param elementId
     * @result void
     **/
    function set_elementId( $elementId ) {
        // sets the value of elementId
        $this->elementId = $elementId;
    }

    /***
     * Set value for field: elementLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param elementLevel
     * @result void
     **/
    function set_elementLevel( $elementLevel ) {
        // sets the value of elementLevel
        $this->elementLevel = $elementLevel;
    }

    /***
     * Set value for field: elementType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param elementType
     * @result void
     **/
    function set_elementType( $elementType ) {
        // sets the value of elementType
        $this->elementType = $elementType;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: eventsbuilding
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param SpentM
     * @param SpentC
     * @param SpentD
     * @param Time
     * @param EventName
     * @param Type
     * @param UserId
     * @param PlanetId
     * @param elementId
     * @param elementLevel
     * @param elementType
     * @result void
     **/
    function createnew_eventsbuilding( $id, $SpentM, $SpentC, $SpentD, $Time, $EventName, $Type, $UserId, $PlanetId, $elementId, $elementLevel, $elementType ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $SpentM,
                      $SpentC,
                      $SpentD,
                      $Time,
                      $EventName,
                      $Type,
                      $UserId,
                      $PlanetId,
                      $elementId,
                      $elementLevel,
                      $elementType); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("eventsbuilding", $_obj);
    }

    /***
     * Retrived an existing record: eventsbuilding
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Eventsbuilding
     **/
    function get_eventsbuilding( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM eventsbuilding WHERE id = '$id'");

        $__eventsbuildingObj = new eventsbuilding();
        // return the retrived from the database

        // create a new object
        $__obj = new Eventsbuilding();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_SpentM($_resultSet[0]['SpentM']);
        $__obj->set_SpentC($_resultSet[0]['SpentC']);
        $__obj->set_SpentD($_resultSet[0]['SpentD']);
        $__obj->set_Time($_resultSet[0]['Time']);
        $__obj->set_EventName($_resultSet[0]['EventName']);
        $__obj->set_Type($_resultSet[0]['Type']);
        $__obj->set_UserId($_resultSet[0]['UserId']);
        $__obj->set_PlanetId($_resultSet[0]['PlanetId']);
        $__obj->set_elementId($_resultSet[0]['elementId']);
        $__obj->set_elementLevel($_resultSet[0]['elementLevel']);
        $__obj->set_elementType($_resultSet[0]['elementType']);


        return $__obj;
    }

    /***
     * Update an existing record: eventsbuilding
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_eventsbuilding( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("eventsbuilding", "id = '$id'");
    }

    /***
     * Delete an existing record: eventsbuilding
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_eventsbuilding( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("eventsbuilding", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: eventsbuilding
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Eventsbuilding
     **/
    function list_eventsbuilding( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM eventsbuilding WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM eventsbuilding";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Eventsbuilding();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_SpentM($__rs['SpentM']);
            $__newObj->set_SpentC($__rs['SpentC']);
            $__newObj->set_SpentD($__rs['SpentD']);
            $__newObj->set_Time($__rs['Time']);
            $__newObj->set_EventName($__rs['EventName']);
            $__newObj->set_Type($__rs['Type']);
            $__newObj->set_UserId($__rs['UserId']);
            $__newObj->set_PlanetId($__rs['PlanetId']);
            $__newObj->set_elementId($__rs['elementId']);
            $__newObj->set_elementLevel($__rs['elementLevel']);
            $__newObj->set_elementType($__rs['elementType']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>